<?php namespace Common\Model;
use Hdphp\Model\Model;
//用户管理模型
class Goodslist extends Model{
	//指定表名
  protected $table = "Goodslist";

  protected $validate = array(
       array('glno','required','货号不能为空',3,3),
       // array('bsort','num:0,65535','排序范围0-65535',3,3),
    );

	public function store(){
		$data = Q('post.');
		// p($data);
		$_POST['group_id'] = implode(',', $data['group_id']);
		p($_POST);
		if(!$this->create()) return false;
		$this->add();
		return true;
	}
	public function edit(){
		$data = Q('post.');
		// p($data);
		$_POST['group_id'] = implode(',', $data['group_id']);
		// p($_POST);
		if(!$this->create()) return false;
		$this->save();
		return true;
	}

}
?>